<%= render :partial => "nav_bar" %>
<%= render :partial => "layouts/top_stories" %>

<div class="left_articles">

<h2>Editing Story: <%= @story.title %></h2>
<BR>
<% form_for(@story) do |f| %>
  <%= f.error_messages %>

  <p>
    <h4><%= f.label :title %></h4>
    <%= f.text_field :title %>
    <h4><%= f.label :rating %></h4>
    <%= select( "story", "story_rating", ["G", "PG", "PG-13", "R", "NC-17"]) %>
    <h4><%= f.label :summary %></h4>
    <%= f.text_area :summary %>
  </p>
  
  <BR>
  <h4>Tags</h4>
  <% if @tags.nil? || @tags.length == 0 %>
  <p>There are no tags to choose from.</p>
  <% else %>
    <select multiple name="tag_ids[]" size=5>
     <% for t in @tags do %>
        <option id="<%= t.id %>" value="<%= t.id %>"<% if @story.tags.include? t %> selected="selected"<%end%>> <%= t.name %>
     <% end %>
     </select>
  <% end %>
  <%= link_to 'add a new tag', :controller=>"tags", :action=>"new", :story=>@story.id %>
  <BR><BR>
  <p>
    <%= f.submit "Update" %>
  </p>
<% end %>

<BR>
<%= link_to '<< Back to Story', @story %> | <%= link_to 'Story Listing', stories_path %>

</div>
</div>
<%= render :partial => "layouts/right_bar" %>